﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>菜单管理 </title>
    <link href="../static/css/admin.css?v=6" rel="stylesheet" />
    <script src="../static/js/boot.js?v=2"></script>
    <script src="../static/js/admin.js?v=2"></script>
    <script>var baseUrl = API_PATH + "/Menu/";
        var keyValue = $.request("keyValue");
        $(function () {
            initControl();
            if (!!keyValue) {
                $.ajax({
                    url: baseUrl + "GetFormJson?keyId=" + keyValue,
                    dataType: "json",
                    async: false,
                    beforeSend: function (jqXHR) {
                        jqXHR.setRequestHeader("Authorization", 'Bearer ' + window.LS.get("lmgcmstoken"));
                    },
                    success: function (data) {
                        $("#form1").formSerialize(data);
                    }
                });
            }
        });
        function initControl() {
            $("#ParentID").bindSelect({
                url: baseUrl + "GetTreeSelectJson",
            });
        }
        function submitForm() {
            if (!$('#form1').formValid()) {
                return false;
            }
            var paramform = $("#form1").formSerialize();
            if (!!keyValue){
                    paramform["ID"] = keyValue;
            }
            if (paramform["Status"]== "true") {
                paramform["Status"] = 1;
            } else {
                paramform["Status"] = 0;
            }
            $.submitForm({
                url: baseUrl + "SubmitForm",
                param: paramform,
                paramType:true,
                success: function () {
                    $.currentWindow().$("#gridList").resetSelection();
                    $.currentWindow().$("#gridList").trigger("reloadGrid");
                }
            })
        }</script>
</head>
<body style="margin:0px;padding:0px;overflow:hidden;">
    <form id="form1">
        <div class="form-layout">
            <input type="hidden" name="ID" value="" />
            <table class="form">
                <tr>
                    <th class="formTitle">上一级</th>
                    <td class="formValue">
                        <select id="ParentID" name="ParentID" class="form-control required">
                            <option value="0">父节点</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">模块标识</th>
                    <td class="formValue">
                        <input id="Code" name="Code" type="text" class="form-control " autocomplete="off" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">模块名称</th>
                    <td class="formValue">
                        <input id="Name" name="Name" type="text" class="form-control " autocomplete="off" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">URL</th>
                    <td class="formValue">
                        <input id="Url" name="Url" type="text" class="form-control " autocomplete="off" />
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">图标</th>
                    <td class="formValue">
                        <div class="input-group">
                            <input id="Icon" name="Icon" type="text" class="form-control " />
                            <span class="input-group-btn">
                                <a class="btn  btn-primary"><i class="fa fa-ellipsis-h"></i></a>
                            </span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">有效</th>
                    <td class="formValue">
                        <div class="ckbox">
                            <input id="Status" name="Status" type="checkbox" checked="checked" value="1" /><label for="Status">启用</label>
                        </div>
                    </td>
                </tr>
                <tr>
                    <th class="formTitle">是否系统模块</th>
                    <td class="formValue">
                        <div class="ckbox">
                            <input id="IsSys" name="IsSys" type="checkbox" checked="checked" value="1" /><label for="IsSys">启用</label>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>